// master
import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import "./assets/style/index.scss"; // 样式文件
// import "element-ui/lib/theme-chalk/index.css"; // element样式 cdn不用引入
// import "@/utils/resize";

Vue.config.productionTip = false;

/* element 全部映入 */
import ElementUI from "element-ui";
Vue.use(ElementUI, {
	size: "small",
	zIndex: 3000,
});

/* 使用animate.css */
import animate from "animate.css";
Vue.use(animate);

/* 引入自定义指令 */
import directive from "./directive/index";
Vue.use(directive);

/* element 按需映入  */
// import './plugins/element'
// Vue.prototype.$ELEMENT = { size: 'small', zIndex: 3000 };

/* 二次确认组件 */
import myConfirm from "./components/confirm/index.js";
Vue.prototype.$confirm = myConfirm;

/* 图片资源懒加载 */
import VueLazyload from "vue-lazyload";
Vue.use(VueLazyload, {
	preLoad: 1.3, // 什么时候加载
	// error: ErrorImg,//加载失败时
	// loading: LoadingImg,//加载时/;
	attempt: 1, // 尝试次数
});

/* 百度地图 */
import BaiduMap from "vue-baidu-map";
Vue.use(BaiduMap, {
	// ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
	ak: "Ng57iPxBivYzzIa3q6Vpg5gQV2PlCi0l",
	enableHighResolution: true,
});

/* 高德地图 */
import VueAMap from "vue-amap";
Vue.use(VueAMap);
// 初始化vue-amap
VueAMap.initAMapApiLoader({
	// 高德的key
	key: "bc6ba45dc9b696d13815d01076bca906",
	// 插件集合
	//   plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor'],
	// 高德 sdk 版本，默认为 1.4.4
	v: "1.4.4",
	plugin: ["AMap.Geolocation", "AMap.Geocoder", "AMap.CitySearch", "AMap.Weather"],
});

/* VueWorker */
import VueWorker from "vue-worker";
Vue.use(VueWorker);

/* 粒子特效 */
import VueParticles from "vue-particles";
Vue.use(VueParticles);

/* 整屏滚动 */
import "fullpage.js/vendors/scrolloverflow"; // Optional. When using scrollOverflow:true
import VueFullPage from "vue-fullpage.js";
Vue.use(VueFullPage);
/* 移动端显示控制台  */
// import VConsole from "vconsole"; // 控制台
// import Devtools from 'vue-vconsole-devtools' // 集合vuex
// Devtools.initPlugin(new VConsole());
export default new Vue({
	router,
	store,
	// 预渲染需要
	mounted() {
		document.dispatchEvent(new Event("render-event"));
	},
	render: h => h(App),
}).$mount("#app");
